<template>

  <div class="store_top">
    <div class="logo">ICE</div>
    <div class="store_name">{{ storedetail.brand_name }}</div>
  </div>

  <div style="{text-align: center;}">
    <img :src="`http://localhost:3001/${storedetail.brand_picture}`" />
  </div>
  <div class="separateline">所有产品</div>
  <div class="cardbox">
    <el-card
      :body-style="{ padding: '0px' }"
      v-for="(item, index) in product"
      :key="index"
      @click="store.dispatch('goproductsellpage', item.product_id)"
    >
      <img
        :src="`http://localhost:3001/${item.product_picture}`"
        class="image"
      />
      <div style="padding: 14px">
        <div class="time">{{ item.product_name }}</div>
      </div>
    </el-card>
  </div>
</template>

<script setup>
import { useRoute } from "vue-router";
import { reactive, ref } from "vue";
import { useStore } from "vuex";
import { brandproductApi,  branddetailsApi } from "../../api/goods";
const route = useRoute();
const store = useStore();
let storedetail = ref({});
let product = ref([]);
const getstoreproduct = async () => {
  let data = await brandproductApi(route.query.id);

  product.value = data.brandProduct;

};
const getstoremessage = async () => {
  let data = await  branddetailsApi(route.query.id);
  storedetail.value = data.brand[0];
};
getstoreproduct();
getstoremessage();
</script>

<style scoped lang="less">
.store_top{
  height: 100px;
  line-height:100px;
  padding: 20px;
  display: flex;
  text-align: center;
  font-size:50px;
  font-weight: 1000;
  .logo{
    padding: 20px;
    border-right: 1px solid #e4e7ed;
    background-color: white;
  }
  .store_name{
    margin-left:  20px;
    background-color: black;
    color: white;
    width: 100%;
   
  }
}
.cardbox {
  display: flex;
  flex-flow: wrap;
}
.image {
  width: 320px;
  height: 400px;
  display: block;
}
.time {
  width: 290px;
  margin: 20px 0;
  text-align: center;
  overflow: hidden;
}
.el-card {
  margin: 20px;
  text-align: center;
}
.separateline {
  height: 100px;
  background-color: #e4e7ed;
  margin: 100px 0;
  text-align: center;
  line-height: 100px;
  font-size: 30px;
  font-weight: 600;
}
</style>
